// 导入实例
import axios from "./config.js";
// fetch走网络
export function fetchLunbo(){
    return axios.get('getlunbo')
}
export function fetchRecommend(page=1,limit=10){
    return axios.get(`/recommend?page=${page}limit=${limit}`)
}
export function fetchGoodsList(page=1,limit=6){
    return axios.get(`/getgoods?page=${page}limit=${limit}`)
}
export function fetchNewsList(page = 1, limit = 6) {
    return axios.get(`/getnewslist?page=${page}&pagesize=${limit}`)
}
export function fetchNewsDetail(newid) {
    return axios.get(`/getnew/${newid}`)
}
export function fetchNewsComment(newid,page=1) {
    return axios.get(`/getcomments/${newid}?pageindex=${page}`)
}
export function fetchPostComment(newid, content) {
    return axios.post(`/postcomment/${newid}`, {
        content
    })
}
export function fetchGoodsImages(goodsid) {
    return axios.get(`/getthumbimages/${goodsid}`)
}

// 获取商品的基本信息
export function fetchGoodsInfo(goodsid) {
    return axios.get(`/getgoodsinfo/${goodsid}`)
}